package com.lx.mobileplayer.mvp.view.adapter

import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter
import com.itheima.player.model.bean.MvAreaBean
import com.lx.mobileplayer.mvp.view.fragment.MvChildFragment

/** 类说明：MV子fragment的适配器
 *  create by liuxiong at 2019/4/27 0027 21:37
 */
class MvChildFragmentAdapter(var data:ArrayList<MvAreaBean>,fm:FragmentManager): FragmentStatePagerAdapter(fm) {

    override fun getItem(position: Int): Fragment {
        var bundle=Bundle()
        bundle.putInt("position",position)
        var fragment=MvChildFragment()
        fragment.arguments=bundle
        return fragment
    }

    override fun getCount(): Int {
        return data.size
    }

    override fun getPageTitle(position: Int): CharSequence? {
        return data.get(position).name
    }
}